import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.List;

public class StaticBook {
	
	List<SetsBook> listbook = new ArrayList<SetsBook>();
	SetsBook book;
	
	
	public void add(){
		
		book = new SetsBook();
		System.out.print("Name: ");
		book.setName(Text.input());
		System.out.print("Autor: ");
		book.setAutor(Text.input());
		listbook.add(book);
		
	
		
		System.out.println("add book complete \n");
		
		
	}
	
	public void list() {

		for (SetsBook getBook : listbook) {
			System.out.println(getBook);
			}
		if(listbook.size() == 0)
		{
			System.out.println("List is empty ");
		}
		
		
		}
	
	

public void delete(){
	try{
	System.out.print("Name: ");
	String name = Text.input();
	System.out.print("Autor: ");
	String autor = Text.input();		
	for (SetsBook books : listbook) {
        if (books.getName().equalsIgnoreCase(name) && books.getAutor().equalsIgnoreCase(autor)) {
			listbook.remove(books);
			break;
		}
	listbook.remove(book);}}
	catch (ConcurrentModificationException CME) {System.out.println("Eror: " + CME);}
	
}
	
}